/*
 * @Description:
 * @Author: wind-lc
 * @version: 1.0
 * @Date: 2023-03-14 17:46:13
 * @LastEditTime: 2023-03-22 17:04:47
 * @FilePath: \cscec-pms-admin\src\api\construction\weekPlanApi.js
 */
import request from '@/utils/request2'
import request2 from '@/utils/request'
import { producerApisUrl, projectApiUrl } from '@/api/config'

const api = {
  queryScheduleNodeWeekTree: producerApisUrl + '/scheduleNodeWeek/queryScheduleNodeWeekTree',
  scheduleNodeWeekExclWeek: producerApisUrl + '/schedulePlanWeek/excl/week',
  schedulePlanWeekExcl: producerApisUrl + '/schedulePlanWeek/excl',
  belongWeekSelect: producerApisUrl + '/scheduleNodeWeek/belongWeekSelect',
  weekPlanDetailSearch: producerApisUrl + '/scheduleNodeWeek/week-plan-detail-search',
  weekPlanTileSearch : producerApisUrl + '/scheduleNodeWeek/week-plan-tile-search',
  createSiblingWorkPack: producerApisUrl + '/scheduleNodeWeek/create-sibling-work-pack',
  createChildWorkPack: producerApisUrl + '/scheduleNodeWeek/create-child-work-pack',
  createChildWork: producerApisUrl + '/scheduleNodeWeek/create-child-work',
  siblingWork: producerApisUrl + '/scheduleNodeWeek/sibling-work',
  moveUp: producerApisUrl + '/scheduleNodeWeek/move-up',
  moveDown: producerApisUrl + '/scheduleNodeWeek/move-down',
  upgradeWorkPack: producerApisUrl + '/scheduleNodeWeek/upgrade-work-pack',
  downgradeWorkPack: producerApisUrl + '/scheduleNodeWeek/downgrade-work-pack',
  removeWorkPack: producerApisUrl + '/scheduleNodeWeek/remove-work-pack',
  removeWork: producerApisUrl + '/scheduleNodeWeek/remove-work',
  editWork: producerApisUrl + '/scheduleNodeWeek/edit-work',
  editWorkPack: producerApisUrl + '/scheduleNodeWeek/edit-work-pack',
  workWithResult: producerApisUrl + '/scheduleNodeWeek/work-with-result',
  nodeMaintain: producerApisUrl + '/scheduleNodeWeek/node-maintain',
  labelTreeList: projectApiUrl + '/plan-label/labelTreeList',
  weekPlanSubmitApproval: producerApisUrl + '/scheduleNodeWeek/week-plan-submit-approval',
  wbstemplate: projectApiUrl + '/construction/wbstemplate',
  weekPlanBulletinBoard: producerApisUrl + '/scheduleNodeWeek/week-plan-bulletin-board',
  weekPlanBulletinBoardDrillDown: producerApisUrl + '/scheduleNodeWeek/week-plan-bulletin-board-drill-down',
  weekPlanPopUpNotification: producerApisUrl + '/scheduleNodeWeek/week-plan-pop-up-notification',
  weekPlanBulletinBoardPicture: producerApisUrl + '/scheduleNodeWeek/week-plan-bulletin-board-picture',
  weekPlanBulletinBoardPictureDown: producerApisUrl + '/scheduleNodeWeek/week-plan-bulletin-board-picture-down',
}
export default {
  /**
   * @description: 获取周计划列表
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  queryScheduleNodeWeekTree: (data) => {
    return request({
      url: api.queryScheduleNodeWeekTree,
      method: 'post',
      data
    })
  },
    /**
   * @description: 获取周计划列表导出接口
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
    scheduleNodeWeekExclWeek: (data) => {
      return request2({
        url: api.scheduleNodeWeekExclWeek,
        method: 'post',
        data,
        responseType: 'arraybuffer'
      })
    },
   /**
   * @description: 获取周计划行导出接口
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
   schedulePlanWeekExcl: (data) => {
      return request2({
        url: `${api.schedulePlanWeekExcl}/${data}`,
        method: 'get',
        responseType: 'arraybuffer'
      })
    },
    /**
   * @description: 获取周计划看板
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
    weekPlanBulletinBoard: (data) => {
    return request({
      url: `${api.weekPlanBulletinBoard}/${data.id}`,
      method: 'get',
    })
  },
  /**
   * @description: 获取周计划看板-逾期节点下钻
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  weekPlanBulletinBoardDrillDown: (data) => {
        return request({
          url: `${api.weekPlanBulletinBoardDrillDown}`,
          method: 'post',
          data
        })
      },
  /**
   *   /**
   * @description: 获取周计划看板-图形下钻
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  weekPlanBulletinBoardPictureDown: (data) => {
    return request({
      url: `${api.weekPlanBulletinBoardPictureDown}`,
      method: 'post',
      data
    })
  },
/**
   * @description: 获取周计划看板-弹窗
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  weekPlanPopUpNotification: (data) => {
    return request({
      url: `${api.weekPlanPopUpNotification}`,
      method: 'post',
      data
    })
  },
    /**
   * @description: 获取周计划看板-图形
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
    weekPlanBulletinBoardPicture: (data) => {
      return request({
        url: `${api.weekPlanBulletinBoardPicture}/${data.id}`,
        method: 'get',
      })
    },
/**
  /**
   * @description: 获取所属周列表
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  belongWeekSelect: (data) => {
    return request({
      url: api.belongWeekSelect,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取周计划详情树列表
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  weekPlanDetailSearch: (data) => {
    return request({
      url: api.weekPlanDetailSearch,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取周计划详情平铺列表
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  weekPlanTileSearch: (data) => {
    return request({
      url: api.weekPlanTileSearch,
      method: 'post',
      data
    })
  },
  /**
   * @description: 新增同级阶段/类别
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  createSiblingWorkPack: (data) => {
    return request({
      url: api.createSiblingWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 新增下级阶段/类别
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  createChildWorkPack: (data) => {
    return request({
      url: api.createChildWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 新增下级业务事项
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  createChildWork: (data) => {
    return request({
      url: api.createChildWork,
      method: 'post',
      data
    })
  },
  /**
   * @description: 新增同级业务事项
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  siblingWork: (data) => {
    return request({
      url: api.siblingWork,
      method: 'post',
      data
    })
  },
  /**
   * @description: 上移
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  moveUp: (data) => {
    return request({
      url: api.moveUp,
      method: 'post',
      data
    })
  },
  /**
   * @description: 下移
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  moveDown: (data) => {
    return request({
      url: api.moveDown,
      method: 'post',
      data
    })
  },
  /**
   * @description: 升级
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  upgradeWorkPack: (data) => {
    return request({
      url: api.upgradeWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 降级
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  downgradeWorkPack: (data) => {
    return request({
      url: api.downgradeWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 删除阶段/类别
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  removeWorkPack: (data) => {
    return request({
      url: api.removeWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 删除业务事项
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  removeWork: (data) => {
    return request({
      url: api.removeWork,
      method: 'post',
      data
    })
  },
  /**
   * @description: 编辑业务事项
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  editWork: (data) => {
    return request({
      url: api.editWork,
      method: 'post',
      data
    })
  },
  /**
   * @description: 编辑阶段/类别
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  editWorkPack: (data) => {
    return request({
      url: api.editWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取工作详情和节点完成信息
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  workWithResult: (data) => {
    return request({
      url: `${api.workWithResult}/${data}`,
      method: 'get'
    })
  },
  /**
   * @description: 节点完成提交
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  nodeMaintain: (data) => {
    return request({
      url: api.nodeMaintain,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取逾期类型树
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  labelTreeList: (data) => {
    return request({
      url: api.labelTreeList,
      method: 'get',
      params: data
    })
  },
  /**
   * @description: 周计划提交
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  weekPlanSubmitApproval: (data) => {
    return request({
      url: api.weekPlanSubmitApproval,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取项目业态
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  wbstemplate: (data) => {
    return request({
      url: api.wbstemplate,
      method: 'get',
      params: data
    })
  }
}
